Think, explore, & write about what the co-evolutionary interaction between newts & snakes with different genetic architectures (GAs, combination of mutation rate & mutation effect size). This markdown is investigating what happens to the newt and snake population when I increase the interaction rate.
How does changing the interaction rate affect the survival of the newt or snake population? Is there a change in the spatial phenotype correlation? Does the interaction rate lead to different phenotype outcome (typical interaction rate is 0.05)? What does changing the interaction rate mean in order of how many snakes encounter a newt in their lifetime?
I created a simulation study to observe the co-evolutionary outcome of the newt-snake interaction with different genetic architectures (GAs) in a spatial setting. I hypothesized that we would see an interaction (co-evolutionary arms race) between newt and snake phenotype under some GA combinations when newts and snakes were evolving over geographical space. Each GA is paired with another GA creating 16 combinations.
GA1 experiment values:
Landscape: A tall map!: 35*4 H, 35 W
I tested different interaction rates:
Each GA combination, trial, and interaction rate has its own msprime simulation.
Sometimes a higher interaction rate will lead to a species extinction, so ending values are approximate
## All cor, lit, and grid files exist!
## This program will now end!
First, I wanted to do some data exploration! So I examined how manipulating the interaction rate would effect some population dynamics. I wanted to pin-point how often snakes could potentially and actuality interact with newts (one is looping through snakes with newts near by and one is counting the amount of times a snake encountered a newt, respectively). These are presented as histograms colored by the interaction rate (look closely at title). I also wanted to explore how interaction rate could impact the population size and mean phenotype of snakes and newts. These are also shown as histograms where color indicates the interaction rate. I also looked for an interaction between interaction rate, the population size of newts and snakes, and the number of interactions that occurred within a generation.
Changing the interaction rate has major consequences for my simulation. If the interaction rate is too low there is not enough selection to increase the mean phenotype of newts and snakes. If the interaction rate is too large there is too much competition between newts and snakes leading to an extinction of one of the species. In my simulation the potential interaction is noted if there is a newt near a snake. This measurement is a combination of the snakes population size and how close the species are to each other. The true number of interactions is based on a mathematical formula that increases the probably of interaction with increasing the interaction rate, but also decreases the probability of interaction with an increase in distance to a newt. This explains why low interaction rates have less interactions, while also explaining why higher interaction rates also have less interactions. Interaction rate has consequences for newt and snake population size and phenotype. At lower interaction rates newts and snakes have a higher population size, but lower mean phenotype. At slightly larger interaction rates newts and snakes have a lower population size, but a higher mean phenotype. At the largest interaction rates the newt and snake populations reach extreme population sizes and high mean phenotypes as one of the species goes extinct. For fun, I explored how each interaction rate changed the population sizes of newts and snakes and the number of interaction that occurred. I found that an interaction rate that is too low or too high ends up having less interactions overall. There is small area of parameter space where interaction rate can be set to (0.025 to 0.075).
surs = 0.5 mPoint = c(ind_snake.x,ind_snake.y); newtNeighbors = i1.nearestNeighborsOfPoint(p1, mPoint, count=1000000);// could make count smaller (limit the number of newts nearby) distance = i1.distanceToPoint(newtNeighbors, mPoint);// vector of distances probablity = interaction_rate * exp(-(distance^2)/(2*(surs^2))) newt_meet_snake = newtNeighbors[runif(length(newtNeighbors)) < probablity] distance might go up and down based on how close newts and snakes
Next, I will look at a plot of how the mean phenotype of the entire population of newts and snakes changes overtime. Each of these plots has three colored lines, red for the mean newt phenotype, blue for the mean snake phenotype, and black for the difference between mean snake and mean newt phenotype. There are 11 lines per color with a shape at the last data point collected that represent the different interaction rates. Note this is a mean for the entire population. Mutational variance increases for the snakes as you go down the figure (top to bottom) and increases for the newts as you go across (left to right).
In previous experiments, I saw a connection between newt/snake phenotype and population size. Typically, when a species had a higher phenotype they also had a larger population size. This relation between phenotype and population size had specific outcomes that depended on the GA of newts and snakes. In this plot I look at how interaction rate might change this observation. Here some of the interaction rates are shown as shapes (I choose to limit the number of interaction rayes I was looking at).
As I have mentioned before, higher interaction rates lead to a populations extinction (for many of them the extinction happens very early > 5,000 generations). However, it does seem that higher interaction rates can lead to a higher mean phenotype. Higher interaction rates seem to run in simulation where both newts and snakes have a larger amount of mutational variance.
The relationship between newt and snake population sizes and the difference between mean phenotype is affected by a change in the interaction rate. A lower interaction rate has higher population sizes and lower mean phenotype differences. I found that as the interaction rate increases the larger the range in population sizes became. I also noticed that larger interaction rates tended to have a larger difference between mean phenotypes and that newts seemed to have larger phenotypes.
In order to understand how spatial correlations where changing with time I took 5,000 generation time slices to look at all correlation values for each of the different interaction rate. Each color is a different interaction rate. Each plot is one GA combination. Mutational variance increases for the snakes as you go down the figure (top to bottom) and increases for the newts as you go across (left to right).
The range of colors in these plots is so pretty! There was no interaction rate that lead to my simulated newts and snakes having a high correlated phenotype similar to the real newt and snake (dashed line) correlation. As the interaction rate increased there was more variation in spatial phenotype correlation. I think this might be due to major decreases in a species population size that occurred when interaction rates were large. Simulations that had one or more species with a higher level of mutational variance were able to persist larger interaction rates.
Next, we will examine three randomly chosen plots from this experiment. Time (in generations) in on the x-axis and both mean phenotype and phenotype spatial correlation in on the y-axis. Newt whole population mean phenotype is red, while snake mean phenotype is blue. The multi-colored line line is the phenotype spatial correlation at different interaction rates.
There is no relationship between mean phenotype and phenotype spatial correlations. The mean phenotype of newts and snakes goes up over time, but the spatial correlation seems to randomly go up and down. Simulations with a high interaction rate typically end up with higher phenotypes, but when the interaction rate is too high a species will die out. The higher the interaction rate the more variable the spatial correlation may get.
Now, we will examine the population size of the three randomly chosen plots from this experiment. Time (in generations) in on the x-axis and both population size and population size spatial correlation in on the y-axis. Newt population size is red, while snake population size is blue. The multi-colored line line is the population spatial correlation at different interaction rates.
There is a connection between population size and interaction rate. The interaction rate has an effect on the population size, but it is difficult to tell because the how different the population sizes are at the smaller sized edges and corners. If all of the measured areas were the same size I predict that there would be more negative correlation.
This section explores how changing the interaction rate affects the first and last 5,000 generations of my co-evolution simulation. Newt and snake population size are on the x and y axis and the point color is the difference between snake and newt mean phenotype. Each plot contains many time points from one simulation with a set GA combination. Mutational variance increases for the snakes as you go down the figure (top to bottom) and increases for the newts as you go across (left to right).
In the early part of my simulation I noticed that as the interaction rate because larger the population size drastically turns in one species favor. A higher interaction rate led to a larger difference between mean phenotype. In the last part of my simulation there are less and less simulations that reach the last 5,000 generations. There is also more difference between GA combinations as the interaction rate increases. For example, each of the the GA combinations ending up having very different population sizes (when compared to lower interaction rates). Some intermediate interaction rates ended up having the largest phenotype differences (potentially due to having more interactions do to the immersion of both species).
This section explores the heatmap plots where the GA of the newt is on the x-axins and the GA of the snake along with the interaction rate for the simulation is on the y-axis. There are two types of heatmap plots shown below. One shows the average snake population size for a time chunk with darker colors indicating a smaller snake population and lighter colors indicating a larger snake population. The other heatmap shows the average difference between snake and newt mean phenotype (red=newts had a higher phenotype, blue=snakes had a higher phenotype). The simulation result is the color in that section.
It seems like higher interaction rates can lead to more differences in snake population size and a larger mean phenotype differences. These results depend on the GA of both the newt and snake, with more variable results appearing when the GA have intermediate phenotype variance (medium mu rate and effect size). It is difficult to tell what is occurring overtime due to the simulations ending early.
This last section will explore how large a snake/newt phenotype or population size is at a certain local region. The squares represent local snakes population values, while the circles represent local newt values. The sub-plots show how the values play out over the samples being located on an edge, corner, or middle of the map. In my true simulation there is no space all of these should be touching.
## [1] -0.05766393
## [1] 0.822828
## [1] 0.01880521
## [1] 0.7237299
## [1] -0.06008882
## [1] 0.3709661
## [1] -0.02381402
## [1] 0.03199683
## [1] 0.5744616
## [1] -0.5816918
## [1] 0.07042592
## [1] -0.5185839
## [1] -0.3938411
## [1] -0.6382031
## [1] 0.02001617
## [1] 0.836511
## [1] 0.2535329
## [1] 0.7900629
## [1] 0.0946622
## [1] 0.5656577
## [1] -0.1860528
## [1] 0.1526687
## [1] 0.403284
## [1] -0.6240611
## [1] 0.1191618
## [1] 0.8463274
## [1] 0.6793459
## [1] 0.7116945
## [1] -0.08046159
## [1] 0.4900344
## [1] 0.4143226
## [1] -0.6583962